import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../layout/Layout.vue'
// import Layout from "@/layout/Layout.vue";

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect:"/index2",
    children: [
      {
        path: '/user',
        name: 'User',
        component: () => import("../views/User.vue")
      },
      {
        path: '/blog',
        name: 'Blog',
        component: () => import("../views/Blog.vue")
      },
      {
        path: '/resource',
        name: 'Resource',
        component: () => import("../views/Resource.vue")
      },
      {
        path: '/resourceAuditing',
        name: 'ResourceAuditing',
        component: () => import("../views/ResourceAuditing.vue")
      }
    ]
  },
  {
    path: '/index2',
    name: 'Index2',
    component: () => import("../views/Index2.vue")
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import("@/views/Login")
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import("@/views/Register")
  },
  {
    path: '/userInformation',
    name: 'UserInformation',
    component: () => import("@/views/index2s/UserInformation")
  },
  {
    path: '/onlyBlog',
    name: 'OnlyBlog',
    component: () => import("@/views/index2s/OnlyBlog")
  },
  {
    path: '/searchYM',
    name: 'SearchYM',
    component: () => import("@/views/index2s/SearchYM")
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
